Skip to content

Conversation

@plemarquand
Copy link
Contributor

We've seen occasional failures to install the Visual Studio Build Tools due to flakey responses from the server.

Attempt to make this script more robust by adding a retry with exponential backoff, attempting up to 10 times before eventually giving up. This adds the same logic to both the VSB and Swift toolchain downloads.

@plemarquand plemarquand requested a review from a team as a code owner November 3, 2025 14:28
Copy link

@bkhouri bkhouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments for your consideration.

@plemarquand plemarquand force-pushed the install-vsb-retries branch 2 times, most recently from 7deb288 to 6e1cdb2 Compare November 4, 2025 16:22
We've seen occasional failures to install the Visual Studio Build Tools
due to flakey responses from the server.

Attempt to make this script more robust by adding a retry with
exponential backoff, attempting up to 10 times before eventually giving
up. This adds the same logic to both the VSB and Swift toolchain
downloads.
##
## This source file is part of the Swift.org open source project
##
## Copyright (c) 2024 Apple Inc. and the Swift project authors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2025

while (-not $Success -and $Attempt -lt $MaxRetries) {
$Attempt++
try {
Invoke-WebRequest -Uri $Uri -OutFile $OutFile
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible just to do a head request or something similar?

Download could fail for other reasons like no disk space, as far as I've seen, the most common issue is network timeout from GH or something similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants